<header class="header-wrap">
    <a href="javascript:void (0)" class="back-off" onclick="window.history.back()"></a>
    <div class="list-search"><input type="text" name="keyword" class="ls-text" value="{if $keyword neq ''}{$keyword}{/if}" placeholder="LLDPE"><input class="ls-btn" type="button" value=""></div>
    <a href="#" class="list-bar"></a>
</header>
<section class="list-menu" style="display:none;">
</section>

{literal}
<script type="text/javascript">
    $(function(){
        var time =new Date();
        var aDent = true;
        var oParent = $('.list-bar');
        var oNodeContent = $('.list-menu');
        oParent.click(function(){
            $.ajax({
                url:'/category/index',
                data:{v:time},
                async:true,
                type:'POST',
                success:function(data){
                    var data = eval("("+data+")");
                    catelist(data);
                },
                dataType:'text'
            });
            if(aDent){
                oNodeContent.stop().slideDown(500);
            }else{
                oNodeContent.stop().slideUp(500);
            }
            aDent = !aDent;
        });
    });

    function catelist(data){
        var list = data;
        var html = "<ul>";
        var i = 1;
        for(var x in list) {
            html += "<li>";
            html += "<a href='/price/index/cn/"+list[x].key+"'>";
            html += "<span class=\"me"+ i +"-icon mi\"></span>";
            html += "<span class=\"mname\">"+list[x].key+"</span>";
            html += "<span class=\"fr orange\">"+list[x].num+ "吨</span>";
            html += "</a>";
            html += "</li>";
            i++;
        }
        html += "</ul>";
        $(".list-menu").html(html);
    }

</script>
{/literal}